#include "exceptiondialog.h"
#include "ui_exceptiondialog.h"

ExceptionDialog::ExceptionDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ExceptionDialog)
{
    this->setWindowTitle("Exception!");
    ui->setupUi(this);
}

ExceptionDialog::ExceptionDialog(const QString& title, GenericException exp, QWidget *parent)
    : QDialog(parent)
{
    this->setWindowTitle(title);

    ui->labelException->setText(exp.message);
    ui->setupUi(this);
}

ExceptionDialog::~ExceptionDialog()
{
    delete ui;
}

void ExceptionDialog::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
